<?php
/*
  $Id: privacy.php 1739 2007-12-20 00:52:16Z hpdl $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  //require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRIVACY);

  $breadcrumb->add("Information");

if(!empty($_GET['id'])) $article_id = (int)$_GET['id'];



//if(!empty($_GET['tid'])) $top_id = (int)$_GET['tid'];

if($article_id==0) die();

//echo $article_id;
if($article_id == 1) $banner_img = "banner_about.jpg";
elseif($article_id == 10) $banner_img = "banner_services.jpg";
else $banner_img = "banner_info.jpg";

//get topic

$topics = array();
$sql = "select ad.articles_name, ad.articles_url,  a.articles_id from articles_to_topics a left join " . TABLE_ARTICLES_DESCRIPTION . " ad   on a.articles_id = ad.articles_id where a.topics_id = '" . (int)$top_id . "'  and ad.language_id = '" . (int)$languages_id . "'";
$article_query = tep_db_query($sql);
      while($doc = tep_db_fetch_array($article_query)){
$topics[] = $doc;

	  }
//print_r($topics);die();

$article_query = tep_db_query("select ad.articles_name, ad.articles_description, ad.articles_url, ad.articles_head_desc_tag, a.articles_id, a.articles_date_added, a.articles_last_modified, date_format(a.articles_date_available, '%Y-%m-%d') as articles_date_available, a.articles_status, a.authors_id from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad where a.articles_id = '" . (int)$article_id . "' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "'");
      $doc = tep_db_fetch_array($article_query);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table width="897" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="72" background="images/3.jpg"><img src="images/3.jpg"/></td>
<!-- body_text //-->

    <td width="100%" valign="top">

        <?php // start index ?>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><?php include 'includes/header_nav.php';?></td>
          </tr>
          <tr>
            <td><img src="images/<?php echo $banner_img;?>" width="755" height="90" /></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="170"><table border="0" cellspacing="0" cellpadding="0">

        <?php foreach($topics as $k => $d){


			if($k){

			?>
                  <tr>
                    <td><img src="images/16.jpg" width="170" height="11" /></td>
                  </tr>

				  <?php }


				  if($d['articles_id'] == $article_id) {
?>

<tr>
                    <td height="25" class="news_text"><div align="right" class="style13"><?php echo $d['articles_name'];?> </div></td>
                  </tr>
<?php

				  } else {
				  ?>
                  <tr>
                    <td height="25" class="news_text"><div align="right"><a href="<?php echo $_SERVER['PHP_SELF'];?>?id=<?php echo $d['articles_id'];?>"><?php echo $d['articles_name'];?></a> </div></td>
                  </tr>
               <?php }

		}?>
                </table>
                  <p>&nbsp;</p>
                  <p>&nbsp;</p>
                  <p>&nbsp;</p>
                  <p>&nbsp;</p>
                  <p>&nbsp;</p>
                  <p>&nbsp;</p></td>
                <td width="49" valign="top"><table width="49" height="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><img src="images/17.jpg" width="49" height="34" /></td>
                  </tr>
                  <tr>
                    <td background="images/18.jpg"><p>&nbsp;</p>
                      <p>&nbsp;</p>
                      <p>&nbsp;</p>
                      <p>&nbsp;</p>
                      <p>&nbsp;</p>
                      <p>&nbsp;</p>
                      <p>&nbsp;</p>
                      <p>&nbsp;</p></td>
                  </tr>
                  <tr>
                    <td><img src="images/17.jpg" width="49" height="34" /></td>
                  </tr>
                </table></td>
                <td valign="top"><table width="98%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><table width="100%" cellpadding="0" cellspacing="0">
                      <tr>
                        <td height="40"><span class="style161"><?php echo $doc['articles_name']; ?></span></td>
                      </tr>
                      <tr>
                        <td class="news_text"><?php echo $doc['articles_description']; ?></td>
                      </tr>
                    </table>
                    </td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>


        </table>

<?php // end index?>

        </td>
<!-- body_text_eof //-->
    <td width="70" background="images/4.jpg"><img src="images/4.jpg" width="70" height="2" /></td>
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
